from typing import *


class Solution:
    def minOperations(self, nums: List[int], k: int) -> int:
        xor = 0
        for num in nums:
            xor ^= num
        j = 1
        ans = 0
        for i in range(31):
            if xor & j != k & j:
                ans += 1
            j <<= 1
        return ans
